<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>权限管理</title>
    <%@ include file="/common/meta.jsp" %>
    <%@ include file="/common/public_input.jsp" %>
    <script>
        $(document).ready(function () {
            //聚焦第一个输入框
            //$("#name").focus();
            //为inputForm注册validate函数
            $("#inputForm").validate({
                rules:{
                    name:{
                        required:true,
                        remote:"check_authrity_name.action?oldAuthrityName=" + $("#oldAuthrityName").val()
                    }

                },
                messages:{
                    name:{
                        remote:"授权名已存在"
                    }

                }
            });
        });
    </script>
</head>

<body>
<div class="div-tabs-nav">
    <ul class="ui-tabs-nav">
        <li class="ui-tabs-selected">系统授权信息</li>
    </ul>
</div>
<%--<h3><s:if test="id == null">创建</s:if><s:else>修改</s:else>权限</h3>--%>
<div class="ui-tabs-panel">
    <form id="inputForm" action="${ctx}/auth/authority/save.action" method="post">
        <div id="message"><s:actionmessage theme="custom" cssClass="success"/></div>
        <div>系统授权<s:if test="id!=null">信息</s:if><s:else>创建</s:else></div>
        <input type="hidden" name="id" value="${id}"/>
        <input type="hidden" id="oldAuthrityName" name="oldAuthrityName" value="${name}"/>
        <table class="noborder">

            <tr>
                <td>权限名称(例如MODIFY_USER):</td>
                <td><s:textfield name="name" size="40" class="required"/></td>
            </tr>

            <tr>
                <td>权限显示名称(例如，修改用户):</td>
                <td><s:textfield name="description" size="40" class="required"/></td>
            </tr>

        </table>
        <div align="left">
            <security:authorize ifAnyGranted="AUTH_MODIFY_USER, AUTH_ALL">
                <input class="button" type="submit" value="提交"/>&nbsp;
            </security:authorize>
            <input type="reset" class="input-button" value="重置"/>
        </div>
    </form>
</div>
</body>
</html>